//
//  NSStringAdditions.h
//  MoCard
//
//  Created by 水石 温 on 11-9-23.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <libxml/tree.h>

#import <CommonCrypto/CommonDigest.h>
#import <CommonCrypto/CommonCryptor.h>

@class MagicRecord;

@interface NSString (DDXML)

/**
 * xmlChar - A basic replacement for char, a byte in a UTF-8 encoded string.
 **/
- (const xmlChar *)xmlChar;

- (NSString *)stringByTrimming;
-(NSString*)trim;
-(NSString*)trimAll;
- (UIColor *)getRGBColor;
- (BOOL)validateAsEmail;
-(NSString*)shortJid;
-(NSString*)userName;
-(NSString*)fileIdFromUrl;//从下载url返回fileId
-(NSString*)fileIdFromWeiboUrl;
-(NSString*)fileIdFromCache;//added by youq for bug 1588
-(NSString*)fileIdFromDocuments;//added by youq for meach 2.0 bug 
-(NSString*)fileIdFromChatPhoto;//added by youq for bug 1588
-(NSInteger)appVersionIntValue;

-(NSString*)calculateConstellationFromBirthdayStr;//根据2007-02-18这样的字符串，返回对应的星座
NSString* timeIntervalStringWithTimeString(NSDate *date);
NSString* timeStringWithDate(NSDate *date);



- (NSString*) HMACWithSecret:(NSString*) secret;

-(int)getNameLength;
@end
